<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<jsp:include page="/WEB-INF/jsp/xhtml-header.jsp"/><head>
<jsp:include page="/WEB-INF/jsp/header.jsp"/>
<title>Error</title>
</head>
<body>
<div>
<h1>An Error Occured ${request['javax.servlet.error.status_code'] }</h1>
<h2><%= request.getAttribute("javax.servlet.error.message") %></h2>
<p>ocurred while accessing: <%=
request.getAttribute("javax.servlet.error.request_uri") %>
(servlet: <%= request.getAttribute("javax.servlet.error.servlet_name")
%>)</p>

<%
Throwable e = (Throwable)request.getAttribute("javax.servlet.error.exception");
while(e!=null)
{
StackTraceElement[] stack = e.getStackTrace();
%>
<table border="1"><caption>Caused by: <%= e.getMessage() %></caption>
<thead>
<tr><th>File</th><th>Line</th><th>Class</th><th>Method</th></tr>
</thead>
<tbody><%
for(StackTraceElement element:stack)
        {
        %><tr>
                <td><%= element.getFileName() %></td>
                <td><%= element.getLineNumber() %></td>
                <td><%= element.getClassName() %></td>
                <td><%= element.getMethodName() %></td>
        </tr><%
        }

%></tbody>
</table>
<hr/>
<%
e=e.getCause();
}%>

</div>
</body>
<jsp:include page="xhtml-footer.jsp"/>